<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class MY_Model extends CI_Model {

    function __construct() {
        parent::__construct();
    }
    
    /**
     * 
     * parse input args
     * example
     * $data('firstname' => 'Hung','lastname' => 'Nguyen')
     * function insert(){
     * 		$args = func_get_args();
     * 		$this->parse_query($args);//parse all data to variant
     * 		
     * 		$sql="insert into A
     * 			  value($this->firstname,$this->lastname)";
     * }
     * $this->user->insert($data);
     * 
     */
	function parse_query(){
		$args = func_get_args();
		foreach ($args[0] as $k => $v){
			$this->$k = $v;
		}
	}
}

?>
